package LanQiaoDemo;

import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;

public class Demo4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        long m = scan.nextLong();
        int count = 0;
        int count1 = 0;//解的个数
        Queue<Long> queue = new LinkedList<>();
        long[] arr = new long[n + 1];//将多项式系数存放到数组中
        while (count != (n + 1)) {
            arr[count++] = scan.nextLong();
        }
        //遍历1-m区间的所有数
        for (long i = 1; i <= m; i++) {
            if (method(i, arr, n + 1)) {
                count1++;
                queue.offer(i);
            }
        }
        System.out.println(count1);
        if (count1 != 0) {
            while (!queue.isEmpty()) {
                System.out.println(queue.poll());
            }
        }
        scan.close();
    }

    //判断num是不是多项式的解
    private static boolean method(long num, long[] arr, int n) {
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += Math.pow(num, i) * arr[i];
        }
        return sum == 0;
    }
}
